package com.zl.learning.maven.javapack;

import java.util.concurrent.TimeUnit;

public class ShutDownHookTest {
    public static void main(String[] args) {
        Runtime.getRuntime().addShutdownHook(new Thread(() -> {
            System.out.println("shutdown");
        }));
        try {
            TimeUnit.SECONDS.sleep(30);
        } catch (InterruptedException e) {
            System.out.println(e.getMessage());
        }
    }
}
